<?php
function M($name=''){
   if($name=='')return new model();
  if(file_exists($curmodel='./model/'.$name.'Model.class.php')){
      include $curmodel;
     $class=$name.'Model';
     return new $class($name);
  }else{
    return new model($name);
  }
}

?>